<?php
/**
 * @fileoverview    推荐关注页
 * @author          zhanglei11
 * @date            Feb  02 11:31:49 CST 2012
 * @copyright       sina meila
 */
include_once ('../../__global.php');
class recommend extends ml_controller{
    
    var $page;
    
     
    public function main(){
//        global $recommendUids;
        
        $uid = $this->__visitor['uid'];
        
        //    实例化2个redis 类
        $redis = new ml_model_rdsCount();
        $oHash = new ml_model_rdsHash();
        
        
        $aCntList = $redis->getUserStat($recommendUids);
        
        
        //取各位昵称
        $nicksList = ml_tool_nick::uids2nicks($recommendUids);
        
        
        //    应该弄一个批量获取的。
        $oBrief = new ml_model_dbUserBriefInfo();
        $oBrief->getBriefByUids($recommendUids);
        
        $tagList = $oBrief->get_data();
        $tagList = Tool_array::format_2d_array($tagList, 'uid',6);
        
//        var_dump($tagList);
        foreach($recommendUids as $k => $v) {            
            $list[$v]['nick'] = $nicksList[$v]=== false ? '' : $nicksList[$k];
            $list[$v]['fansCnt'] = $aCntList[$v]['uFSC'];
            $list[$v]['followCnt'] = $aCntList[$v]['uFC'];
            $list[$v]['contentCnt'] = $aCntList[$v]['uCC'];
            $list[$v]['attCnt'] = $aCntList[$v]['uAttC'];            
            $list[$v]['head'] = ml_tool_picid::uid2portrait($v,'big').rand(1,99999);    //头像
//            $list[$v]['tag'] = isset($tagList[$k]) ? $tagList[$k] :'木有标签';
            $list[$v]['declaration']  = $tagList[$v]['declaration'];    //    美啦宣言
        }
    
    
        /* 
        $obizUser = ml_biz_user_getinfo::get_instance();
        $obizUser->initUser($this->_uid,$this->__visitor['uid']);
        $userData = $obizUser->getUserArea();
         */
        $this->set_page_title('推荐关注');
        $this->set_scope_var('$notice', "");
        $this->page_output('recommend',$list);
    }
    
    function initParam() {
        
        $this->page = $tmp=$this->input('page','G',0);
    }
    
    /**
     * @develop_template
     * 检查参数合法性
     */
    function checkParam() {
        if(!isset($this->__visitor['uid'])) {
            $this->redirect(ML_PAGE_LOGIN);
        }
    }


}
new recommend();
?>